package jbl.action;
import jbl.pageModel.UserGroupMenu;
import jbl.service.UserGroupMenuServiceI;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ModelDriven;

@Namespace("/")
@Action(value="userGroupMenuAction")
/**
 * 
 * @author jblcxg
 * 
 * 用户组合菜单的管理表信息管理  具体的分配到用户的权限
 *
 */
public class UserGroupMenuAction extends BaseAction implements ModelDriven<UserGroupMenu>{
	private UserGroupMenu userGroupMenu=new UserGroupMenu();

	private UserGroupMenuServiceI userGroupMenuService;
	
	@Autowired
	public void setUserGroupMenuService(
			UserGroupMenuServiceI userGroupMenuService) {
		this.userGroupMenuService = userGroupMenuService;
	}

	@Override
	public UserGroupMenu getModel() {
		return userGroupMenu;
	}
	/**
	 * 获取权限dataGrid
	 * 
	 */
	public void dataGrid(){
		writeJson(userGroupMenuService.dataGrid());
	}
	/**
	 * 添加权限菜单
	 */
	public void add(){
		writeJson(userGroupMenuService.add(userGroupMenu));
	}
	/**
	 * 删除权限菜单
	 */
	public void delete(){
		writeJson(userGroupMenuService.delete(userGroupMenu.getIds()));
	}
	/**
	 * 编辑权限菜单
	 */
	public void edit(){
		writeJson(userGroupMenuService.edit(userGroupMenu));
	}

}
